import React from 'react'
import { useSelector } from 'react-redux'
/**
 * 商品列表页
 * @returns 
 */
export default function GoodsList() {
    const { goodsList } = useSelector(state => state.goods);
    return (
        <div>
            <ul>

                {goodsList.map(goods => (
                    <li key={goods.id}>
                        <p>商品名: {goods.gname}</p>
                        <p>价格: {goods.price}</p>
                        <p><button>加入购物车</button></p>
                    </li>
                ))}
            </ul>
        </div>
    )
}
